From 8f09f5ed1674ddf635c6ac26afe785cb3a80f77d Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Wed, 4 Jun 2003 14:19:18 +0000 Subject: [PATCH] bitkeeper revision 1.252 (3eddffe6IQ1eZ1bHUcbBhwG8ApEXrA) processor.h, setup.c, process.c: Further IOPL fix -- also initial idle thread has current->thread.esp0 initialised to a non-zero value. --- .../arch/xeno/kernel/process.c | 13 +++++-------- .../arch/xeno/kernel/setup.c | 2 -- .../include/asm-xeno/processor.h | 3 ++- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c b/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c index c1764fce50..b4e7a6cd14 100644 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c +++ b/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c @@ -365,14 +365,11 @@ void __switch_to(struct task_struct *prev_p, struct task_struct *next_p) queue_multicall0(__HYPERVISOR_fpu_taskswitch); } - if ( next->esp0 != 0 ) - { - queue_multicall2(__HYPERVISOR_stack_switch, __KERNEL_DS, next->esp0); - /* Next call will silently fail if we are a non-privileged guest OS. */ - queue_multicall2(__HYPERVISOR_set_priv_levels, - ((((struct pt_regs *)next->esp0)-1)->eflags>>12)&3, - next->hypercall_pl); - } + queue_multicall2(__HYPERVISOR_stack_switch, __KERNEL_DS, next->esp0); + /* Next call will silently fail if we are a non-privileged guest OS. */ + queue_multicall2(__HYPERVISOR_set_priv_levels, + ((((struct pt_regs *)next->esp0)-1)->eflags>>12)&3, + next->hypercall_pl); /* EXECUTE ALL TASK SWITCH XEN SYSCALLS AT THIS POINT. */ execute_multicall_list(); diff --git a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/setup.c b/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/setup.c index 21db2e8f01..68fedf85fd 100644 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/setup.c +++ b/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/setup.c @@ -302,7 +302,6 @@ void __init setup_arch(char **cmdline_p) paging_init(); - /* Set privilege level gubbins. */ regs->eflags &= ~(3<<12); if ( start_info.flags & SIF_PRIVILEGED ) { /* We are privileged guest os - should have IO privileges. */ @@ -310,7 +309,6 @@ void __init setup_arch(char **cmdline_p) panic("Unable to obtain IOPL, despite being SIF_PRIVILEGED"); regs->eflags |= 1<<12; } - current->thread.hypercall_pl = 1; if(start_info.flags & SIF_CONSOLE) { diff --git a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/processor.h b/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/processor.h index d3547ea2bc..eb2effd3f0 100644 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/processor.h +++ b/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/processor.h @@ -369,7 +369,8 @@ struct thread_struct { unsigned long v86flags, v86mask, saved_esp0; }; -#define INIT_THREAD { 0, 0, 0, 0, 0, 1, {0}, 0, 0, 0, {0}, 0, 0, 0, 0, 0 } +#define INIT_THREAD { sizeof(init_stack) + (long) &init_stack, \ + 0, 0, 0, 0, 1, {0}, 0, 0, 0, {0}, 0, 0, 0, 0, 0 } #define INIT_TSS { \ 0,0, /* back_link, __blh */ \ -- 2.30.2